﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using WaterBill.DAL;
using WaterBill.DTO;

namespace WaterBill.BUS
{
    class BUS_Hamlets : DAL_Hamlets
    {
        DataTable dtH;

        //Lay danh sach tat ca cac ap
        public DataTable BUS_Hamlets_GetAll()
        {
            dtH = new DataTable();
            try
            {
                dtH = DAL_Hamlets_GetAll();
            }
            catch
            {
            }
            return dtH;
        }

        //Lay danh sach cac ap co trang thai bang 1
        public DataTable BUS_Hamlets_GetStatusEnable()
        {
            dtH = new DataTable();
            try
            {
                dtH = DAL_Hamlets_GetStatusEnable();
            }
            catch
            {
            }
            return dtH;
        }

        //Them mot ap moi
        public Boolean BUS_Hamlets_Insert(DTO_Hamlets obj)
        {
            try
            {
                if (DAL_Hamlets_Insert(obj))
                {
                    return true;
                }
            }
            catch
            {
            }
            return false;
        }

        //Sua ap
        public Boolean BUS_Hamlets_Update(DTO_Hamlets obj)
        {
            try
            {
                if (DAL_Hamlets_Update(obj))
                {
                    return true;
                }
            }
            catch
            {
            }
            return false;
        }

        //Xoa ap
        public Boolean BUS_Hamlets_Delete(int HamletId)
        {
            try
            {
                if (DAL_Hamlets_Delete(HamletId))
                {
                    return true;
                }
            }
            catch
            {
            }
            return false;
        }
    }
}
